home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group95b.txt
/
000069_icon-group-sender _Thu Jun 22 19:30:00 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1995-09-18
|
3KB
Received: by cheltenham.cs.arizona.edu; Sat, 8 Jul 1995 10:57:31 MST
Message-Id: <9506221930.AA10945@ns1.computek.net>
Mime-Version: 1.0
Content-Length: 2594
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Date: Thu, 22 Jun 95 19:30 CDT
From: gep2@computek.net
Subject: Re: ICON and Data Conversion
To: icon-group@cs.arizona.edu
X-Mailer: SPRY Mail Version: 04.00.06.14
Errors-To: icon-group-errors@cs.arizona.edu
>From your reply (saying I gave no evidence that Perl is better than Icon)
I must conclude that I wasn't clear :-).
I am not saying Perl or AWK are better, only that it takes less time to
learn how to use them (in a basic way),
The learning of how to use SNOBOL4 "in a basic way" can be taught in less than
five or ten minutes. Here is a basic SNOBOL4 program template:
A LINE = INPUT :F(END)
B LINE pattern = replacement :S(B)
OUTPUT = LINE :(A)
END
The program will read a text file and replace the first occurrence on each line
of the given pattern with the given replacement. For example, if you use a
pattern of "Mrs." and replacement of "Ms.", you'll get the replacement
indicated.
Admittedly, there are some more specialized tools that can do this trivial job
almost as well, but with SNOBOL4 you're not limited to only those simple jobs.
For example, an only slightly more complex pattern and replacement would be:
pattern: SPAN("0123456789.") . N
replacement: N + 1
That would take the first numeric substring (including real numbers) in each
record, and increment the numeric value by one.
>since most programs know that basics of regular expressions from school.
There's no reason why they shouldn't be taught SNOBOL4 patterns in school,
instead of the far more limited REs.
>I must admit that I haven't used S4, just read the book and tried some
simple examples.
I've found that, without exception, the people I know who swear by AWK and Perl
are people who haven't really bothered to learn SNOBOL4. On the other hand, I
don't know ANYBODY who's learned SNOBOL4 who has any interest whatsoever in
either AWK or Perl. Why would a person want to switch to a more limited, less
powerful tool?
>You may be right that we should use this group to intorduce new people to
these languages.
Well, I don't see much point in "introducing" Perl or AWK. There are enough
people who know, and enough books about, those already. But I don't mind
discussing SNOBOL4 here, since (after all) so many of the design concepts
underlying Icon are those that derive from SNOBOL4.
>I suppose that a small regualr posting on S4 can be the right thing to do.
You might want to take a look at the information on my Web page about SNOBOL4,
and it also has a link for downloading the freeware Vanilla SNOBOL4. That
package comes with a very well-written (almost 150 pages) tutorial and user's
guide, it's an excellent way to learn the language.
Gordon Peterson
http://www.computek.net/public/gep2/